﻿@{
    Layout = "~/Views/Shared/_Root.cshtml";
}
@{
    //current category ID
    int currentCategoryId = 0;
    if (Url.RequestContext.RouteData.Values["controller"].ToString().Equals("catalog", StringComparison.InvariantCultureIgnoreCase) &&
        Url.RequestContext.RouteData.Values["action"].ToString().Equals("category", StringComparison.InvariantCultureIgnoreCase))
    {
        currentCategoryId = Convert.ToInt32(Url.RequestContext.RouteData.Values["categoryId"].ToString());
    }


    //current manufacturer ID
    //int currentManufacturerId = 0;
    //if (Url.RequestContext.RouteData.Values["controller"].ToString().Equals("catalog", StringComparison.InvariantCultureIgnoreCase) &&
    //    Url.RequestContext.RouteData.Values["action"].ToString().Equals("manufacturer", StringComparison.InvariantCultureIgnoreCase))
    //{
    //    currentManufacturerId = Convert.ToInt32(Url.RequestContext.RouteData.Values["manufacturerId"].ToString());
    //}


    //current product ID
    int currentProductId = 0;
    if (Url.RequestContext.RouteData.Values["controller"].ToString().Equals("catalog", StringComparison.InvariantCultureIgnoreCase) &&
        Url.RequestContext.RouteData.Values["action"].ToString().Equals("product", StringComparison.InvariantCultureIgnoreCase))
    {
        currentProductId = Convert.ToInt32(Url.RequestContext.RouteData.Values["productId"].ToString());
    }
}
<div class="side-2">
    @if (IsSectionDefined("left"))
    {
        @RenderSection("left")
    }
    else
    {
        @Html.Widget("left_side_column_before")
        <div class="clear">
        </div>  
        @Html.Action("CategoryNavigation", "Catalog", new {currentCategoryId, currentProductId })
        <div class="clear">
        </div>
        @Html.Action("Support", "Common")
        <div class="clear">
        </div>
        @*Html.Action("Branch", "Common")
        <div class="clear">
        </div>*@
        @Html.Action("LeftAds", "Common")
        <div class="clear">
        </div>
        @Html.Widget("left_side_column_after")
    }
</div>
<div class="center-2">
    @Html.Widget("main_column_before")
    @RenderBody()
    @Html.Widget("main_column_after")
</div>
